package com.fwj.authorization.staff.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fwj.authorization.staff.entity.SysPermissionRole;
import com.fwj.authorization.staff.mapper.SysPermissionRoleMapper;
import com.fwj.authorization.staff.service.SysPermissionRoleService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 权限角色
 *
 * @author 樊温军
 * @date 2025/3/18 上午10:32
 */
@Service
public class SysPermissionRoleServiceImpl extends ServiceImpl<SysPermissionRoleMapper, SysPermissionRole> implements SysPermissionRoleService {

    @Override
    public IPage<SysPermissionRole> getPage(Page<SysPermissionRole> page, SysPermissionRole sysPermissionRole) {
        return baseMapper.getPage(page, sysPermissionRole);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public Boolean savePermissionRole(List<SysPermissionRole> sysPermissionRoles) {
        return this.saveOrUpdateBatch(sysPermissionRoles);
    }
}
